<!doctype html>



  


<html class="theme-next mist use-motion" lang="en">
<head>
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="statistical learning," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="Chapter 3 REVIEW">
<meta property="og:type" content="article">
<meta property="og:title" content="statistical-learning-2">
<meta property="og:url" content="https://annashuo.github.io/2017/03/09/statistical-learning-2/index.html">
<meta property="og:site_name" content="Anna's Blog">
<meta property="og:description" content="Chapter 3 REVIEW">
<meta property="og:updated_time" content="2017-03-09T09:03:24.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="statistical-learning-2">
<meta name="twitter:description" content="Chapter 3 REVIEW">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"right","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://annashuo.github.io/2017/03/09/statistical-learning-2/"/>





  <title> statistical-learning-2 | Anna's Blog </title><!-- hexo-inject:begin --><!-- hexo-inject:end -->
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  
<!-- hexo-inject:begin --><!-- hexo-inject:end --><script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '',
      xfbml      : true,
      version    : 'v2.6'
    });
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>



<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-105321506-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?6f5ab2ef1e021070500f7228c830f3c6";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Anna's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
    
      <p class="site-subtitle">My heart is in the work...</p>
    
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="https://annashuo.github.io/2017/03/09/statistical-learning-2/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Anna">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Anna's Blog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Anna's Blog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                statistical-learning-2
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-03-09T10:42:47-05:00">
                2017-03-09
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/statistical-learning/" itemprop="url" rel="index">
                    <span itemprop="name">statistical learning</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/03/09/statistical-learning-2/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count fb-comments-count" data-href="https://annashuo.github.io/2017/03/09/statistical-learning-2/" itemprop="commentCount">0</span> comments
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>Chapter 3 REVIEW</p>
<a id="more"></a>
<h3 id="简单线性回归"><a href="#简单线性回归" class="headerlink" title="简单线性回归"></a>简单线性回归</h3><script type="math/tex; mode=display">Y=\beta _{0}+\beta _{1}X+\varepsilon</script><script type="math/tex; mode=display">\widehat{y}=\widehat{\beta} _{0}+\widehat{\beta} _{1}x</script><p>$\varepsilon $的原因：</p>
<ul>
<li>真实的x和y的关系可能不是线性的</li>
<li>存在测量误差</li>
<li>$\varepsilon $服从$N(0,\vartheta ^{2}),\, \, \, \vartheta ^{2}=\sum\varepsilon ^{2}$</li>
<li>对$\varepsilon$的估计称为残差标准误$RSE=\sqrt{RSS/(n-2)}$</li>
</ul>
<h4 id="残差平方和-residual-sum-of-square"><a href="#残差平方和-residual-sum-of-square" class="headerlink" title="残差平方和 residual sum of square"></a>残差平方和 residual sum of square</h4><script type="math/tex; mode=display">RSS=e_{1}^{2}+e_{2}^{2}+...e_{n}^{2},\, \, \, e_{i}=y_{i}-\widehat{y}_{i}=y_{i}-\widehat{\beta }_{0}-\widehat{\beta }_{1}x</script><script type="math/tex; mode=display">\therefore RSS=\sum (y_{i}-\widehat{y}_{i})^{2}=\sum (y_{i}-\widehat{\beta }_{0}-\widehat{\beta }_{1}x)^{2}</script><h4 id="最小二乘法求解得"><a href="#最小二乘法求解得" class="headerlink" title="最小二乘法求解得"></a>最小二乘法求解得</h4><script type="math/tex; mode=display">\widehat{\beta }_{1}=\frac{\sum (x_{i}-\overline{x})(y_{i}-\overline{y})}{\sum (x_{i}-\overline{x})^{2}}=\frac{l_{xy}}{l_{xx}}</script><script type="math/tex; mode=display">\widehat{\beta }_{0}=\overline{y}-\widehat{\beta }_{1}\overline{x}</script><p>定义样本均值$\widehat{\mu }$，随机变量Y总体均值$\mu$。衡量$\widehat{\mu }$对$\mu$的估计有多准确，用$\widehat{\mu }$的标准误差$SE(\widehat{\mu })$</p>
<p>$\widehat{\mu }$的方差$Var(\widehat{\mu })=SE(\widehat{\mu })^{2}=\frac{\vartheta ^{2}}{n}$</p>
<p>同理，衡量$\widehat{\beta}<em>{0}$和$\widehat{\beta}</em>{1}$分别对$\beta<em>{0}$和$\beta</em>{1}$估计的准确性，用$SE(\widehat{\beta}<em>{0})$和$SE(\widehat{\beta}</em>{1})$</p>
<script type="math/tex; mode=display">SE(\widehat{\beta }_{0})^{2}=\vartheta ^{2}[\frac{1}{n}+\frac{\overline{x}^{2}}{\sum (x_{i}-\overline{x})^{2}}]</script><script type="math/tex; mode=display">SE(\widehat{\beta }_{1})^{2}=\frac{\vartheta ^{2}}{\sum (x_{i}-\overline{x})^{2}}</script><h4 id="95-的置信区间："><a href="#95-的置信区间：" class="headerlink" title="95%的置信区间："></a>95%的置信区间：</h4><p>该范围有95%的概率会包含未知参数的真实值。</p>
<p>$\beta<em>{1}$的95%置信区间为 $\widehat{\beta}</em>{1}\pm 2\cdot SE(\widehat{\beta}_{1})$</p>
<p>$\beta<em>{0}$的95%置信区间为 $\widehat{\beta}</em>{0}\pm 2\cdot SE(\widehat{\beta}_{0})$</p>
<h4 id="t-statistc-和p-value确定X和Y之间是否有关系"><a href="#t-statistc-和p-value确定X和Y之间是否有关系" class="headerlink" title="t-statistc 和p-value确定X和Y之间是否有关系"></a>t-statistc 和p-value确定X和Y之间是否有关系</h4><p>零假设$H<em>{0}$: X和Y之间无关。$H</em>{0}: \beta _{1}=0$</p>
<p>备择假设$H<em>{a}$: X和Y之间存在一定关系  $H</em>{a}: \beta _{1}\neq 0$</p>
<p>t-statistic: </p>
<script type="math/tex; mode=display">t=\frac{\widehat{\beta }_{1}}{SE(\widehat{\beta }_{1})}</script><p>假设$H_{0}$成立，则t-statistic服从自由度n-2的t分布</p>
<p>定义p-value为任意观测值大于等于$\left | t \right |$的概率</p>
<p>如果p-value足够小，则拒绝$H_{0}$</p>
<h4 id="模型准确性度量"><a href="#模型准确性度量" class="headerlink" title="模型准确性度量"></a>模型准确性度量</h4><p>一旦拒绝了$H_{0}$，就可以讨论模型的准确性，即确定拟合质量，用两个标准</p>
<ul>
<li><strong>绝对测度：残差标准误RSE</strong></li>
</ul>
<p>RSE是$\varepsilon $的估计，RSE是模型对数据失拟的绝对测度。</p>
<script type="math/tex; mode=display">RSE=\sqrt{RSS/(n-2)}=\sqrt{\sum (y_{i}-\widehat{y}_{i})^{2}/(n-2)}</script><ul>
<li><strong>相对测度：$R^{2}$统计量</strong></li>
</ul>
<p>$R^{2}$是一个比例，取值在0到1之间</p>
<script type="math/tex; mode=display">R^{2}=\frac{TSS-RSS}{TSS}=1-\frac{RSS}{TSS}=\frac{ESS}{TSS}</script><p>总平方和 $TSS=\sum (y_{i}-\overline{y})^{2}$：执行回归分析前响应变量中的固有变异性</p>
<p>残差平方和 $RSS=\sum (y<em>{i}-\widehat{y}</em>{i})^{2}$：回归之后仍无法解释的变异性</p>
<p>回归平方和 $ESS=\sum (\widehat{y}_{i}-\overline{y})^{2}$：响应变量进行回归之后被消除的变异性</p>
<script type="math/tex; mode=display">TSS=RSS+ESS</script><p>相关性：</p>
<script type="math/tex; mode=display">Cor(X,Y)=\frac{\sum (x_{i}-\overline{x})(y_{i}-\overline{y})}{\sqrt{\sum (x_{i}-\overline{x})^{2}}\sqrt{\sum (y_{i}-\overline{y})^{2}}}=\frac{l_{xy}}{\sqrt{l_{xx}}\sqrt{l_{yy}}}</script><p>在简单线性回归中，$R^{2}=Cor(X,Y)^{2}$</p>
<h3 id="多元线性回归"><a href="#多元线性回归" class="headerlink" title="多元线性回归"></a>多元线性回归</h3><script type="math/tex; mode=display">Y=\beta _{0}+\beta _{1}X+\beta _{2}X_{2}+...+\beta _{p}X_{p}+\varepsilon</script><script type="math/tex; mode=display">\widehat{y}=\widehat{\beta} _{0}+\widehat{\beta} _{1}x+\widehat{\beta }_{2}x_{2}+...+\widehat{\beta }_{p}x_{p}</script><h4 id="残差平方和-residual-sum-of-square-1"><a href="#残差平方和-residual-sum-of-square-1" class="headerlink" title="残差平方和 residual sum of square"></a>残差平方和 residual sum of square</h4><script type="math/tex; mode=display">RSS=\sum (y_{i}-\widehat{y}_{i})^{2}=\sum (y_{i}-\widehat{\beta }_{0}-\widehat{\beta }_{1}x-...-\widehat{\beta }_{p}x_{p})^{2}</script><h4 id="F统计量"><a href="#F统计量" class="headerlink" title="F统计量"></a>F统计量</h4><p>零假设$H<em>{0}$: X和Y之间无关。$H</em>{0}: \beta <em>{1}=\beta </em>{2}=…=\beta _{p}=0$</p>
<p>备择假设$H<em>{a}$: X和Y之间存在一定关系  $H</em>{a}: $至少有一个$\beta _{j}$不为0</p>
<p>F统计量：</p>
<script type="math/tex; mode=display">F=\frac{(RSS_{0}-RSS)/q}{RSS/(n-p-1)}</script><p>当$H<em>{0}$成立时，F-&gt;1，F服从F分布，$E[(TSS-RSS)/p]=\vartheta ^{2}$；当$H</em>{a}$成立时，F&gt;1</p>
<p>n比较大时，小F值即可拒绝$H<em>{0}$；n比较小时，需要大的F值才能拒绝$H</em>{0}$</p>
<h4 id="确定重要变量"><a href="#确定重要变量" class="headerlink" title="确定重要变量"></a>确定重要变量</h4><ul>
<li>向前选择 forward selection</li>
<li>向后选择 backward selection， p&gt;n时不可用</li>
<li>混合选择 mixed selection</li>
</ul>
<h4 id="模型拟合质量"><a href="#模型拟合质量" class="headerlink" title="模型拟合质量"></a>模型拟合质量</h4><p>残差标准误</p>
<script type="math/tex; mode=display">RSE=\sqrt{RSS/(n-p-1)}</script><h4 id="其他问题"><a href="#其他问题" class="headerlink" title="其他问题"></a>其他问题</h4><ul>
<li>定性变量</li>
</ul>
<p>转化为哑变量(dump variable)</p>
<ul>
<li>拓展交互项</li>
</ul>
<p><strong>有交互项的模型不是可加的</strong></p>
<p>实验分层原则(hierarchical principle): 模型一定含有交互项的主效应项</p>
<ul>
<li>非线性关系：多项式回归</li>
<li><p>潜在问题</p>
<ul>
<li>数据的非线性：残差图是否有模式(U型等)</li>
<li>误差项$\varepsilon _{i}$自相关：残差图是否有tracking的现象</li>
<li>误差项$\varepsilon _{i}$方差不恒定：残差图是否成漏斗状(funnel shape)</li>
<li>outliers：用$studentized\, residual=\frac{e_{i}}{RSE}&gt;3$则为outliers</li>
<li><p>高杆杠点</p>
<p>leverage statistic: </p>
<script type="math/tex; mode=display">h_{i}=\frac{1}{n}+\frac{(x_{i}-\overline{x})^{2}}{\sum (x_{i}-\overline{x})^{2}},\, \, \, \frac{1}{n}<h_{i}<1\, \, 且\, \, \frac{1}{n}\sum h_{i}=\frac{p+1}{h}</script></li>
<li><p>collinearity：用RSS等高线图看</p>
<p>collinearity提高，$SE(\widehat{\beta}<em>{i})$提高，t-statistic降低，$H</em>{0}$无法拒绝</p>
<p>检验方法一：相关系数矩阵，但存在multicollinearity问题</p>
<p>检验方法二：</p>
<script type="math/tex; mode=display">VIF(\widehat{\beta }_{i})=\frac{1}{1-R_{j}^{2}}</script></li>
</ul>
</li>
</ul>
<h4 id="linear-regression-vs-KNN"><a href="#linear-regression-vs-KNN" class="headerlink" title="linear regression vs KNN"></a>linear regression vs KNN</h4><ol>
<li>参数和非参数方法优缺点</li>
<li>如果选定的参数形式，接近$f$的真实形式，则参数法更优</li>
<li>如果真实关系是非线性的，flexibility提高，KNN测试集MSE变化小，线性回归的test MSE提高。但在非线性情况下，KNN结果可能更差，尤其是维度大的时候。</li>
<li>纬度灾难(curse of dimensionality)</li>
</ol>
<h3 id="补充证明"><a href="#补充证明" class="headerlink" title="补充证明"></a>补充证明</h3><script type="math/tex; mode=display">y=X\beta +\varepsilon</script><p>if $\varepsilon $ is constant variance $\vartheta ^{2}$，$\beta =(X^{T}X)^{-1}X^{T}y$</p>
<p>if $\varepsilon $ is non-constant variance</p>
<script type="math/tex; mode=display">\varepsilon \sim \begin{pmatrix}
\vartheta _{1}^{2} & 0 & ... & 0\\ 
0 &  \vartheta _{2}^{2}&  ...& 0\\ 
 ...&  ...&  ...& ...\\ 
0 & 0 & ... & \vartheta _{n}^{2}
\end{pmatrix}</script><p>weight matrix:</p>
<script type="math/tex; mode=display">W= \begin{pmatrix}
\frac{1}{\vartheta _{1}^{2}} & 0 & ... & 0\\ 
0 &  \frac{1}{\vartheta _{2}^{2}}&  ...& 0\\ 
 ...&  ...&  ...& ...\\ 
0 & 0 & ... & \frac{1}{\vartheta _{n}^{2}}
\end{pmatrix}</script><script type="math/tex; mode=display">\beta =(X^{T}WX)^{-1}X^{T}Wy</script>
      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/statistical-learning/" rel="tag"># statistical learning</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/03/08/statistical-learning-1/" rel="next" title="statistical-learning-1">
                <i class="fa fa-chevron-left"></i> statistical-learning-1
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/03/09/statistical-learning-3/" rel="prev" title="statistical-learning-3">
                statistical-learning-3 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>

          
          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="fb-comments"
           data-href="https://annashuo.github.io/2017/03/09/statistical-learning-2/"
           data-numposts="10"
           data-width="100%"
           data-colorscheme="light">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="Anna" />
          <p class="site-author-name" itemprop="name">Anna</p>
          <p class="site-description motion-element" itemprop="description">My heart is in the work...</p>
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">43</span>
                <span class="site-state-item-name">posts</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">12</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/Annashuo/Annashuo.github.io" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/u/1861044584?is_all=1" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#简单线性回归"><span class="nav-number">1.</span> <span class="nav-text">简单线性回归</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#残差平方和-residual-sum-of-square"><span class="nav-number">1.1.</span> <span class="nav-text">残差平方和 residual sum of square</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最小二乘法求解得"><span class="nav-number">1.2.</span> <span class="nav-text">最小二乘法求解得</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#95-的置信区间："><span class="nav-number">1.3.</span> <span class="nav-text">95%的置信区间：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#t-statistc-和p-value确定X和Y之间是否有关系"><span class="nav-number">1.4.</span> <span class="nav-text">t-statistc 和p-value确定X和Y之间是否有关系</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#模型准确性度量"><span class="nav-number">1.5.</span> <span class="nav-text">模型准确性度量</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#多元线性回归"><span class="nav-number">2.</span> <span class="nav-text">多元线性回归</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#残差平方和-residual-sum-of-square-1"><span class="nav-number">2.1.</span> <span class="nav-text">残差平方和 residual sum of square</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#F统计量"><span class="nav-number">2.2.</span> <span class="nav-text">F统计量</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#确定重要变量"><span class="nav-number">2.3.</span> <span class="nav-text">确定重要变量</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#模型拟合质量"><span class="nav-number">2.4.</span> <span class="nav-text">模型拟合质量</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#其他问题"><span class="nav-number">2.5.</span> <span class="nav-text">其他问题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#linear-regression-vs-KNN"><span class="nav-number">2.6.</span> <span class="nav-text">linear regression vs KNN</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#补充证明"><span class="nav-number">3.</span> <span class="nav-text">补充证明</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Anna</span>
</div>


<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	





  





  

  
      <!-- UY BEGIN -->
      <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid="></script>
      <!-- UY END --><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->
  




  
  

  
  


  

  

  


</body>
</html>
